package org.lmind.arena.ui;

public class Position {
	
	private long value;
	
	public Position(int x, int y) {
		value = ((long)y) << 32 | x;
	}
	
	public int getX() {
		return (int)(value & 0xFFFFFFFF);
	}
	
	public int getY() {
		return (int)(value & 0xFFFFFFFF00000000L);
	}
	
	@Override
	public int hashCode() {
		return Long.valueOf(value).hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Position) {
			return ((Position)obj).value == value;
		}
		return false;
	}

	@Override
	public String toString() {
		return Long.valueOf(value).toString();
	}

}
